{% extends "base.html" %}
{% block title %} 我出售的商品{% endblock %}
{% block header %}

{% endblock %}

{% block content %}


<div class="container">
  <div class="span12">
    <ul class="nav nav-tabs">
      <li><a href="\my\">我的资料</a></li>
      <li class="active"><a href="\my_sell\">我出售的商品</a></li>
      <li><a href="\my_buy\">我购买的商品</a></li>
      <li><a href="\my_add\">添加新商品</a></li>
    </ul>
  </div>
</div>

<div class="container">
  <div class="span12">
    <ul class="thumbnails">
      {% for g in goods %}
      <li class="span4">
        <div class="thumbnail">
          <a href="\item_detail\?gid={{g.id}}" class="img_box">
            <img src="{{g.img}}" alt="" width="260" class="img">
          </a>
          <h2>{{g.name}}</h2>

          <h4>标签： 
            {% for tag in g.tags %}
            <span class="label">{{tag}}</span> 
            {% endfor %}
          </h4>
          <h4>价格：{{g.price}}元</h4>
          {% if not g.flags %}
          <p><a class="btn btn-danger" href="\delete_goods\?gid={{g.id}}">删除</a></p>
          {% else %}
          <p><a class="btn btn-info" href="\item_detail\?gid={{g.id}}">已出售</a></p>
          {% endif %}
        </div>
      </li>
      {% else %}
      <h3>空空如也~</h3>
      {% endfor %}
    </ul>
  </div>
  {% if goods %}
  <div class="span12">
    <div class="pagination pagination-centered">
      <ul>
        {% if now_page == 1 %}
        <li class="disabled"><a>&laquo;</a></li
        {% else %}
        <li><a href="/my_sell/?page={{now_page-1}}">&laquo;</a></li>
        {% endif %}

        {% for i in all_page %}
        {% if i== now_page %}
        <li class="active"><a href="/my_sell/?page={{i}}">{{i}}</a></li>
        {% else%}
        <li><a href="/my_sell/?page={{i}}">{{i}}</a></li>
        {% endif%}
        {% endfor %}

        {% if now_page == count_page %}
        <li class="disabled"><a>&raquo;</a></li>
        {% else %}
        <li><a href="/my_sell/?page={{now_page+1}}">&raquo;</a></li>
        {% endif %}


      </ul>
    </div>
  </div>
  {% endif %}

</div>

{% endblock %}